
package dieci.hibernate;

import dieci.database.PersistentObject;
import dieci.system.Price;

/**
 *
 * @author DuckSys
 */
public class HibPrice implements PersistentObject{

    private HibPriceId id;
    private double price;

    public HibPrice()
    {
    }

    public HibPrice(Price price, Long productId)
    {
        id = new HibPriceId();
        id.setProductId(productId);
        id.setPriceDate(price.getPriceDate());
        this.price = price.getPriceValue();
    }

    
    /**
     * Get the value of price
     *
     * @return the value of price
     */
    public double getPrice()
    {
        return price;
    }

    /**
     * Set the value of price
     *
     * @param price new value of price
     */
    public void setPrice(double price)
    {
        this.price = price;
    }

    
    /**
     * Get the value of id
     *
     * @return the value of id
     */
    public HibPriceId getId()
    {
        return id;
    }

    /**
     * Set the value of id
     *
     * @param id new value of id
     */
    public void setId(HibPriceId id)
    {
        this.id = id;
    }

}
